Repository navigation
Conversation
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more |
There was a problem hiding this comment.
Do we need to change the license part here?
There was a problem hiding this comment.
Hi @jongyoul ,
This license part has been restored.
e61cd40 to
9339d43
Compare
| <groupId>org.apache.commons</groupId> | ||
| <artifactId>commons-lang3</artifactId> | ||
| <groupId>org.apache.zeppelin</groupId> | ||
| <artifactId>zeppelin-shell</artifactId> |
There was a problem hiding this comment.
@paul8263 I know it's the proper way to extend the existing feature but I wouldn't recommend to include another interpreter. It sometimes leads unexpected behaviors as we designed every interpreter as independent component. Could you please mimic and/or re-implement features you use only in this interpreter? I'm also planning to existing dependencies between interpreters in the following year.
There was a problem hiding this comment.
Hi @jongyoul ,
Thanks for the review.
ShellInterpreter lives in zeppelin-shell, and other interpreters already subclass it the same way — flink-cmd and spark-submit both declare this exact dependency. The kerberos handling section can be resued and avoid duplication.
Adding mutual-dependency between interpreters might not be an elegant way. Currently, I don’t have a good idea for this part. Please feel free to share if you have a better solution.
What is this PR for?
Refactor HbaseInterpreter to extend ShellInterpreter instead of reimplementing shell process management from scratch.
The previous implementation duplicated a lot of logic that ShellInterpreter already provides: writing each paragraph to a temp script file, constructing a DefaultExecutor with a PumpStreamHandler, managing an ExecuteWatchdog, implementing cancel() and a FIFO scheduler, and cleaning up temp files. This patch deletes all of that (about 150 lines) and reduces HbaseInterpreter to the HBase-specific part only: resolving HBASE_HOME and turning a paragraph into one hbase shell invocation.
The main motivation is Kerberos support. ShellInterpreter extends KerberosInterpreter, so by subclassing it the HBase interpreter now inherits the same, already-tested Kerberos handling for free: zeppelin.shell.auth.type=kerberos, zeppelin.shell.keytab.location, zeppelin.shell.principal, and the periodic re-kinit on ticket expiry. No HBase-specific Kerberos code is required, and the same approach can be reused by any other shell-backed interpreter.
What type of PR is it?
Improvement / Refactoring
Todos
What is the Jira issue?
[ZEPPELIN-6770]
How should this be tested?
This update has been covered by UTs.
./mvnw test -pl hbase -am
Screenshots (if appropriate)
Questions: